home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / pc / ps40sdk / examples / common / rez-files.r / pigeneral.r < prev    next >
Encoding:
Text File  |  1996-10-14  |  13.6 KB  |  538 lines

  1. /*
  2.     File: PIGeneral.r
  3.  
  4.     Copyright (c) 1991-6, Adobe Systems Incorporated.
  5.     All rights reserved.
  6.  
  7.     Rez file describing Plug-in resources.
  8. */
  9.  
  10. #ifndef __PIGeneral_r__
  11. #define __PIGeneral_r__
  12.  
  13. #ifndef kPIPropertiesVersion
  14. #define kPIPropertiesVersion 0
  15. #endif
  16.  
  17. // Dont include this file on MSWindows resources
  18.  
  19. #define qIncludeMe 1
  20.  
  21. #ifdef MSWindows
  22. #undef qIncludeMe
  23. #define qIncludeMe !MSWindows
  24. #endif
  25.  
  26. #if qIncludeMe
  27.  
  28. /* First, temporarily define Pipl types for easier rezing */
  29. #define PIPiplTypes Filter = '8BFM',            \
  30.                     Parser = '8BYM',            \
  31.                     ImageFormat='8BIF',            \
  32.                     Extension = '8BXM',            \
  33.                     Acquire = '8BAM',            \
  34.                     Export = '8BEM',            \
  35.                     Selection = '8BSM',            \
  36.                     Picker = '8BCM'
  37.  
  38. type 'PiPL'
  39.     {
  40.     longint = kPIPropertiesVersion;
  41.     longint = $$CountOf(properties);
  42.     array properties
  43.         {
  44.         switch
  45.             {
  46.  
  47. /* Properties for all types of plug-ins. */
  48.  
  49.             case Kind:
  50.                 longint = '8BIM';
  51.                 key longint = 'kind';
  52.                 longint = 0;
  53.                 longint = 4;
  54.                 literal longint PIPiplTypes;
  55.  
  56.             case Version:
  57.                 longint = '8BIM';
  58.                 key longint = 'vers';
  59.                 longint = 0;
  60.                 longint = 4;
  61.                 longint;
  62.  
  63.             case Priority:
  64.                 longint = '8BIM';
  65.                 key longint = 'prty';
  66.                 longint = 0;
  67.                 longint = 4;
  68.                 longint;
  69.  
  70.             case RequiredHost:
  71.                 longint = '8BIM';
  72.                 key longint = 'host';
  73.                 longint = 0;
  74.                 longint = 4;
  75.                 literal longint;
  76.  
  77.             case Name:
  78.                 longint = '8BIM';
  79.                 key longint = 'name';
  80.                 longint = 0;
  81. #if DeRez
  82.                 fill long;
  83. #else
  84.                 longint = (nameEnd[$$ArrayIndex(properties)] - nameStart[$$ArrayIndex(properties)]) / 8;
  85. #endif
  86.               nameStart:
  87.                 pstring;
  88.               nameEnd:
  89.                 align long;
  90.  
  91.             case Category:
  92.                 longint = '8BIM';
  93.                 key longint = 'catg';
  94.                 longint = 0;
  95. #if DeRez
  96.                 fill long;
  97. #else
  98.                 longint = (catgEnd[$$ArrayIndex(properties)] - catgStart[$$ArrayIndex(properties)]) / 8;
  99. #endif
  100.               catgStart:
  101.                 pstring;
  102.               catgEnd:
  103.                 align long;
  104.  
  105.             case Code68k:
  106.                 longint = '8BIM';
  107.                 key longint = 'm68k';
  108.                 longint = 0;
  109.                 longint = 6;
  110.                 literal longint PIPiplTypes;
  111.                 integer;
  112.                 align long;
  113.  
  114.             case Code68kFPU:
  115.                 longint = '8BIM';
  116.                 key longint = '68fp';
  117.                 longint = 0;
  118.                 longint = 6;
  119.                 literal longint PIPiplTypes;
  120.                 integer;
  121.                 align long;
  122.  
  123.             case CodePowerPC:
  124.                 longint = '8BIM';
  125.                 key longint = 'pwpc';
  126.                 longint = 0;
  127. #if DeRez
  128.                 fill long;
  129. #else
  130.                 longint = (pwpcEnd[$$ArrayIndex(properties)] - pwpcStart[$$ArrayIndex(properties)]) / 8;
  131. #endif
  132.               pwpcStart:
  133.                 longint;
  134.                 longint;
  135.                 pstring;
  136.               pwpcEnd:
  137.                 align long;
  138.  
  139. #ifdef MSWindows /* For documentation purposes only. */
  140.             case CodeWin32X86:
  141.                 longint = '8BIM';
  142.                 key longint = 'wx86';
  143.                 longint = 0;
  144.                 longint = (win32x86End[$$ArrayIndex(properties)] - win32x86Start[$$ArrayIndex(properties)]) / 8;
  145.               win32x86Start:
  146.                 cstring;
  147.               win32x86End:
  148.                 align long;
  149. #endif
  150.  
  151.             case SupportedModes:
  152.                 longint = '8BIM';
  153.                 key longint = 'mode';
  154.                 longint = 0;
  155. #if DeRez
  156.                 fill long;
  157. #else
  158.                 longint = (modeEnd[$$ArrayIndex(properties)] - modeStart[$$ArrayIndex(properties)]) / 8;
  159. #endif
  160.               modeStart:
  161.                 boolean noBitmap, doesSupportBitmap;
  162.                 boolean noGrayScale, doesSupportGrayScale;
  163.                 boolean noIndexedColor, doesSupportIndexedColor;
  164.                 boolean noRGBColor, doesSupportRGBColor;
  165.                 boolean noCMYKColor, doesSupportCMYKColor;
  166.                 boolean noHSLColor, doesSupportHSLColor;
  167.                 boolean noHSBColor, doesSupportHSBColor;
  168.                 boolean noMultichannel, doesSupportMultichannel;
  169.                 boolean noDuotone, doesSupportDuotone;
  170.                 boolean noLABColor, doesSupportLABColor;
  171.                 fill bit[6];
  172.               modeEnd:
  173.                 align long;
  174.  
  175.             case EnableInfo:
  176.                 longint = '8BIM';
  177.                 key longint = 'enbl';
  178.                 longint = 0;
  179. #if DeRez
  180.                 fill long;
  181. #else
  182.                 longint = (EnableInfoEnd[$$ArrayIndex(properties)] - EnableInfoStart[$$ArrayIndex(properties)]) / 8;
  183. #endif
  184.               EnableInfoStart:
  185.                 cstring;
  186.               EnableInfoEnd:
  187.                 align long;
  188.  
  189. /* Filter plug-in properties. */
  190.  
  191.             case FilterCaseInfo:
  192.                 longint = '8BIM';
  193.                 key longint = 'fici';
  194.                 longint = 0;
  195.                 longint = 28;
  196.                 array [7]
  197.                     {
  198.                     byte inCantFilter = 0,
  199.                          inStraightData = 1,
  200.                          inBlackMat = 2,
  201.                          inGrayMat = 3,
  202.                          inWhiteMat = 4,
  203.                          inDefringe = 5,
  204.                          inBlackZap = 6,
  205.                          inGrayZap = 7,
  206.                          inWhiteZap = 8,
  207.                          inBackgroundZap = 10,
  208.                          inForegroundZap = 11;
  209.                     byte outCantFilter = 0,
  210.                          outStraightData = 1,
  211.                          outBlackMat = 2,
  212.                          outGrayMat = 3,
  213.                          outWhiteMat = 4,
  214.                          outFillMask = 9;
  215.                     fill bit [4];
  216.                     boolean doNotWriteOutsideSelection, writeOutsideSelection;
  217.                     boolean doesNotFilterLayerMasks, filtersLayerMasks;
  218.                     boolean doesNotWorkWithBlankData, worksWithBlankData;
  219.                     boolean copySourceToDestination, doNotCopySourceToDestination;
  220.                     fill byte;
  221.                     } ;
  222.  
  223. /* Export plug-in properties. */
  224.  
  225.             case ExportFlags:
  226.                 longint = '8BIM';
  227.                 key longint = 'expf';
  228.                 longint = 0;
  229. #if DeRez
  230.                 fill long;
  231. #else
  232.                 longint = (expFlagsEnd[$$ArrayIndex(properties)] - expFlagsStart[$$ArrayIndex(properties)]) / 8;
  233. #endif
  234.              expFlagsStart:
  235.                 boolean expDoesNotSupportTransparency, expSupportsTransparency;
  236.                 fill bit[7];
  237.               expFlagsEnd:
  238.                 align long;
  239.  
  240. /* Format plug-in properties. */
  241.  
  242.             case FmtFileType:
  243.                 longint = '8BIM';
  244.                 key longint = 'fmTC';
  245.                 longint = 0;
  246.                 longint = 8;
  247.                 literal longint; /* Default file type. */
  248.                 literal longint; /* Default file creator. */
  249.  
  250.             case ReadTypes:
  251.                 longint = '8BIM';
  252.                 key longint = 'RdTy';
  253.                 longint = 0;
  254.                 longint = $$CountOf(ReadableTypes) * 8;
  255.                 wide array ReadableTypes { literal longint; literal longint; } ;
  256.  
  257.             case WriteTypes:
  258.                 longint = '8BIM';
  259.                 key longint = 'WrTy';
  260.                 longint = 0;
  261.                 longint = $$CountOf(WritableTypes) * 8;
  262.                 wide array WritableTypes { literal longint; literal longint; } ;
  263.  
  264.             case FilteredTypes:
  265.                 longint = '8BIM';
  266.                 key longint = 'fftT';
  267.                 longint = 0;
  268.                 longint = $$CountOf(FilteredTypes) * 8;
  269.                 wide array FilteredTypes { literal longint; literal longint; } ;
  270.  
  271.             case ReadExtensions:
  272.                 longint = '8BIM';
  273.                 key longint = 'RdEx';
  274.                 longint = 0;
  275.                 longint = $$CountOf(ReadableExtensions) * 4;
  276.                 wide array ReadableExtensions { literal longint; } ;
  277.  
  278.             case WriteExtensions:
  279.                 longint = '8BIM';
  280.                 key longint = 'WrEx';
  281.                 longint = 0;
  282.                 longint = $$CountOf(WriteableExtensions) * 4;
  283.                 wide array WriteableExtensions { literal longint; } ;
  284.  
  285.             case FilteredExtensions:
  286.                 longint = '8BIM';
  287.                 key longint = 'fftE';
  288.                 longint = 0;
  289.                 longint = $$CountOf(FilteredExtensions) * 4;
  290.                 wide array FilteredExtensions { literal longint; } ;
  291.  
  292.             case FormatFlags:
  293.                 longint = '8BIM';
  294.                 key longint = 'fmtf';
  295.                 longint = 0;
  296.                 longint = (fmtFlagsEnd[$$ArrayIndex(properties)] - fmtFlagsStart[$$ArrayIndex(properties)]) / 8;
  297.              fmtFlagsStart:
  298.                 boolean = false; /* Obsolete flag. */
  299.                 boolean fmtDoesNotSaveImageResources, fmtSavesImageResources;
  300.                 boolean fmtCannotRead, fmtCanRead;
  301.                 boolean fmtCannotWrite, fmtCanWrite;
  302.                 boolean fmtWritesAll, fmtCanWriteIfRead;
  303.                 fill bit[3];
  304.               fmtFlagsEnd:
  305.                 align long;
  306.  
  307.             case FormatMaxSize:
  308.                 longint = '8BIM';
  309.                 key longint = 'mxsz';
  310.                 longint = 0;
  311.                 longint = 4;
  312.                 Point;
  313.  
  314.             case FormatMaxChannels:
  315.                 longint = '8BIM';
  316.                 key longint = 'mxch';
  317.                 longint = 0;
  318.                 longint = $$CountOf(ChannelsSupported) * 2;
  319.                 wide array ChannelsSupported { integer; } ;
  320.                 align long;
  321.  
  322. /* Parser Properties. */
  323.  
  324.             case ParsableTypes:
  325.                 longint = '8BIM';
  326.                 key longint = 'psTY';
  327.                 longint = 0;
  328.                 longint = $$CountOf(ParsableTypes) * 8;
  329.                 wide array ParsableTypes { literal longint; literal longint; } ;
  330.  
  331.             case ParsableExtensions:
  332.                 longint = '8BIM';
  333.                 key longint = 'psEX';
  334.                 longint = 0;
  335.                 longint = $$CountOf(ParsableExtensions) * 4;
  336.                 wide array ParsableExtensions { literal longint; };
  337.  
  338.             case FilteredParsableTypes:
  339.                 longint = '8BIM';
  340.                 key longint = 'psTy';
  341.                 longint = 0;
  342.                 longint = $$CountOf(ParsableTypes) * 8;
  343.                 wide array ParsableTypes { literal longint; literal longint; } ;
  344.  
  345.             case FilteredParsableExtensions:
  346.                 longint = '8BIM';
  347.                 key longint = 'psEx';
  348.                 longint = 0;
  349.                 longint = $$CountOf(ParsableExtensions) * 4;
  350.                 wide array ParsableExtensions { literal longint; };
  351.  
  352.             case ParsableClipboardTypes:
  353.                 longint = '8BIM';
  354.                 key longint = 'psCB';
  355.                 longint = 0;
  356.                 longint = $$CountOf(ParsableClipboardTypes) * 4;
  357.                 wide array ParsableClipboardTypes { literal longint; };
  358.  
  359. /* Picker Properties. */
  360.  
  361.             case PickerID:
  362.                 longint = '8BIM';
  363.                 key longint = 'pnme';
  364.                 longint = 0;
  365. #if DeRez
  366.                 fill long;
  367. #else
  368.                 longint = (PickerIDEnd[$$ArrayIndex(properties)] - PickerIDStart[$$ArrayIndex(properties)]) / 8;
  369. #endif
  370.               PickerIDStart:
  371.                 pstring;            // The ID string
  372.               PickerIDEnd:
  373.                 align long;
  374.  
  375. /* New in 4.0 */
  376.                 
  377.             case HasTerminology:
  378.                 longint = '8BIM';
  379.                 key longint = 'hstm';
  380.                 longint = 0;
  381.                 longint = (hasTermEnd[$$ArrayIndex(properties)] - hasTermStart[$$ArrayIndex(properties)]) / 8;
  382.             hasTermStart:
  383.                 longint = 0;    // version
  384.                 longint;        // classID
  385.                 longint;        // eventID
  386.                 integer;        // terminologyID
  387.                 cstring;        // scopeString
  388.             hasTermEnd:
  389.                 align long;
  390.             };
  391.         };
  392.     };
  393.  
  394. #undef PIPiplTypes
  395.  
  396. /********************************************************************************/
  397.  
  398. #ifndef PiMIVersion
  399. #define PiMIVersion 0
  400. #endif
  401.  
  402. type 'PiMI'
  403. {
  404. Start:                /* The following is common to all Photoshop 2.5 Plugin modules      */
  405.     integer;                        /* The version number of the interface supported. */
  406.     integer;                        /* The sub-version number.                          */
  407.     integer;                        /* The plug-in's priority.                        */
  408.     integer = (General-Start)/8;    /* The size of the general info.                  */
  409.     integer = (TypeInfo-General)/8;    /* The size of the type specific info.              */
  410.     integer;                        /* A bit mask indicating supported image modes.   */
  411.     literal longint;                /* A required host if any.                          */
  412. General:
  413.  
  414.     array {            /* The following is used only for Format Plugin modules              */
  415.         integer = $$Countof(TypeArray);                /* type count */
  416.         integer = $$Countof(ExtensionArray);        /* extension count */
  417.         byte  cannotRead, canRead;                    /* Can we read using this format?                  */
  418.         byte  cannotReadAll, canReadAll;            /* Can this plug-in read from all files?          */
  419.         byte  cannotWrite, canWrite;                /* Can we write using this format?                  */
  420.         byte  cannotWriteIfRead, canWriteIfRead;    /* Can we write if we read using this format?      */
  421.         byte  doesntSaveResources, savesResources;    /* Does this file format save the resource data?  */
  422.         #if PiMIVersion > 0
  423.         byte  doesntSupportsFilterCalls, supportsFilterCalls; /* Supports filter calls for formats. */
  424.         #else
  425.         fill byte;                    /* Padding */
  426.         #endif
  427.         wide array [16]
  428.             { integer; };            /* Maximum # of channels with each plug-in mode.  */
  429.         integer;                    /* Maximum rows allowed in document.              */
  430.         integer;                    /* Maximum columns allowed in document.              */
  431.         literal longint;            /* The file type if we create a file.              */
  432.         literal longint;            /* The creator type if we create a file.          */
  433.         array TypeArray
  434.         {
  435.             literal longint;        /* The type-creator pairs supported.              */
  436.             literal longint;
  437.         };
  438.         array ExtensionArray
  439.         {
  440.             literal longint;        /* The extensions supported.                      */
  441.         };
  442.     };
  443. TypeInfo:
  444. };
  445.     
  446. #define supportsBitmap             1
  447. #define supportsGrayScale        2
  448. #define supportsIndexedColor    4
  449. #define supportsRGBColor        8
  450. #define supportsCMYKColor       16
  451. #define supportsHSLColor       32
  452. #define supportsHSBColor       64
  453. #define supportsMultichannel  128
  454. #define supportsDuotone          256
  455. #define supportsLABColor      512
  456.  
  457. #define flagSupportsBitmap          128
  458. #define flagSupportsGrayScale      64
  459. #define flagSupportsIndexedColor  32
  460. #define flagSupportsRGBColor      16
  461. #define flagSupportsCMYKColor       8
  462. #define flagSupportsHSLColor       4
  463. #define flagSupportsHSBColor       2
  464. #define flagSupportsMultichannel   1
  465. #define flagSupportsDuotone         128
  466. #define flagSupportsLABColor      64
  467.  
  468. #define latestAcquireVersion        4
  469. #define latestAcquireSubVersion        0
  470. #define latestExportVersion            4
  471. #define latestExportSubVersion        0
  472. #define latestExtensionVersion        1
  473. #define latestExtensionSubVersion    0
  474. #define latestFilterVersion            4
  475. #define latestFilterSubVersion        0
  476. #define latestFormatVersion            1
  477. #define latestFormatSubVersion        0
  478. #define latestParserVersion            1
  479. #define latestParserSubVersion        0
  480. #define latestSelectionVersion        1
  481. #define latestSelectionSubVersion    0
  482. #define latestPickerVersion            1
  483. #define latestPickerSubVersion        0
  484.  
  485.  
  486. #if 0
  487.  
  488. /* Example of Format plugin resource */
  489.  
  490. resource 'PiMI' (16000, purgeable)
  491. {
  492.     latestFormatVersion,     /* Version, subVersion, and priority of the interface */
  493.     latestFormatSubVersion,
  494.     0,
  495.     supportsGrayScale+supportsRGBColor+supportsCMYKColor,
  496.     '8BIM',
  497.     
  498.     {
  499.         canRead,
  500.         cannotReadAll,
  501.         canWrite,
  502.         canWriteIfRead,
  503.         doesntSaveResources,
  504.         { 0, 1, 0, 3,
  505.           4, 0, 0, 0,
  506.           0, 0, 0, 0,
  507.           0, 0, 0, 0 },
  508.         32767,
  509.         32767,
  510.         'JPEG',
  511.         '8BIM',
  512.         {
  513.             'JPEG', '8BIM'
  514.         },
  515.         {
  516.             'JPG '
  517.         }
  518.     }
  519. };
  520.  
  521. /* Example of Acquire/Export resource */
  522.  
  523. resource 'PiMI' (16001, purgeable)
  524. {
  525.     latestAcquireVersion,     /* Version, subVersion, and priority of the interface */ 
  526.     latestAcquireSubVersion, 
  527.     0,
  528.     supportsGrayScale+supportsRGBColor+supportsCMYKColor,
  529.     '8BIM',
  530.     {}            /* Null Format extension field */
  531. };
  532.  
  533. #endif /* Examples */
  534.  
  535. #endif    /* qIncludeMe */
  536.  
  537. #endif    /* PIGeneral.r */
  538.